﻿namespace UFIDA.U9.Hello.ConfigBP
{
	using System;
	using System.Collections.Generic;
	using System.Text; 
	using UFSoft.UBF.AopFrame;	
	using UFSoft.UBF.Util.Context;
    using UFSoft.UBF.Util.DataAccess;

    /// <summary>
    /// ConfigUpdate partial 
    /// </summary>	
    public partial class ConfigUpdate 
	{	
		internal BaseStrategy Select()
		{
			return new ConfigUpdateImpementStrategy();	
		}		
	}
	
	#region  implement strategy	
	/// <summary>
	/// Impement Implement
	/// 
	/// </summary>	
	internal partial class ConfigUpdateImpementStrategy : BaseStrategy
	{
		public ConfigUpdateImpementStrategy() { }

		public override object Do(object obj)
		{						
			ConfigUpdate bpObj = (ConfigUpdate)obj;

			if (bpObj.QCSchema == null)
				throw new Exception("传入参数为空");

			foreach(var dto in bpObj.QCSchema)
            {
				string sql = $"update QC_QCSchema set DescFlexField_PrivateDescSeg1='更新完成' where ID={dto.ID}";
				DataAccessor.RunSQL(DataAccessor.GetConn(), sql, null);

			}
			return null;
			
		}		
	}

	#endregion
	
	
}